<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        剩余时间：
    </div>

    <script>
        let year = prompt('请输入年份')-0
        let month = prompt('请输入月份')-0
        let day = prompt('请输入日')-0
        let hour = prompt('请输入时')-0
        let minute = prompt('请输入分')-0
        let second = prompt('请输入秒')-0
        setInterval(()=>{
            let data1 = new Date()
            let data2 = new Date(year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second)
            let data = data2-data1
            let newData = Math.floor(data/1000)
            let div = document.querySelector('div')
            div.innerHTML ='剩余时间'+ newData
        },1000)
    </script>
</body>
</html>